/**
 * Seed the random number generator used by `random` and `randomRange`.
 */
public function seed(seed: Uint) {
    srand(seed);
}

/**
 * Generates a random number between 0 and 1.
 */
public function random(): Double {
    return rand() as Double / ${RAND_MAX: Uint16};
}

/**
 * Generates a random integer between min and max, inclusive.
 */
public function randomRange(min: Int, max: Int): Int {
    return min + (((1 + max - min) * random()) as Int);
}
